// https://nuxt.com/docs/api/configuration/nuxt-config
import type { NuxtPage } from 'nuxt/schema'

export default defineNuxtConfig({
    compatibilityDate: '2025-07-15',
    devtools: {enabled: true},
    modules: ['@pinia/nuxt', '@nuxtjs/i18n', '@element-plus/nuxt', '@nuxt/icon'],
    pinia: {
        storesDirs: ['./app/stores/**'],
    },
    css: [
        '~/assets/css/main.css',
        'element-plus/dist/index.css'
    ],
    icon: {
        customCollections: [
            {
                prefix: 'wac-icon',
                dir: './app/assets/icons-svg'
            },
        ],
    },
    elementPlus: {
        importStyle: 'scss',
        defaultLocale: 'zh-cn',
        globalConfig: {
            size: 'small',
            zIndex: 3000
        }
    },
    i18n: {
        locales: [
            {code: 'zh-cn', name: '简体中文', file: "zh-cn.json"},
            {code: 'en', name: 'English', file: "en.json"}
        ],
        defaultLocale: 'zh-cn',
        langDir: '../app/locales',
        strategy: 'prefix_except_default',
        detectBrowserLanguage: {
            useCookie: true,
            cookieKey: 'wac_i18n',
            alwaysRedirect: false,
            redirectOn: 'root'
        }
    },
    app: {
        head: {
            title: '凡品【Fanpin】',
            meta: [
                {name: 'description', content: '这是maxcon给woaicc构建的一个nuxt应用'}
            ]
        }
    },
    /** @type {import('vite').UserConfig} */
    vite: {
    },
    ssr: true
})